<?php
/**
 * PsiFramework
 *
 * Php Simple Framework
 *
 * PHP version 5.3
 *
 * @category  PsiFramework.Plugins.Form.Classes.Model
 * @package   PsiFramework.Plugins.Form.Classes.Model
 * @author    Remi San <remi.san@gmail.com>
 * @copyright 2011 Remi San
 * @license   http://creativecommons.org/licenses/by/3.0/  Creative Commons CC BY 3.0
 * @version   SVN: <svn_id>
 * @link      http://www.psiframework.com/phpdoc/classes/db_\PsiFramework\Plugins\Form\Classes\Model\FormResponse.html
 */

namespace PsiFramework\Plugins\Form\Classes\Model;

import("Classes.Model.PolymorphicObject");

use \PsiFramework\Classes\Model\PolymorphicObject;
use \PsiFramework\Classes\Util\Object\Date;

/**
 * The FormResponse Object
 *
 * This is the class for the FormResponse Object
 *
 * @category PsiFramework.Plugins.Form.Classes.Model
 * @package  PsiFramework.Plugins.Form.Classes.Model
 * @author   Remi San <remi.san@gmail.com>
 * @license  http://creativecommons.org/licenses/by/3.0/  Creative Commons CC BY 3.0
 * @link     http://www.psiframework.com/phpdoc/classes/db_\PsiFramework\Plugins\Form\Classes\Model\FormResponse.html
 */
class FormResponse extends PolymorphicObject
{
    /**
     * @var int
     */
    protected /*int*/       $_formResponseId ;
    /**
     * @var IUser
     */
    protected /*IUser*/     $_user ;
    /**
     * @var Form
     */
    protected /*Form*/      $_form ;
    /**
     * @var FormField
     */
    protected /*FormField*/ $_field ;
    /**
     * @var Date
     */
    protected /*Date*/      $_modificationDate ;

    /**
     * Constructor
     * 
     * @param int       $formResponseId   The response id
     * @param IUser     $user             The user
     * @param Form      $form             The form
     * @param FormField $field            The field
     * @param Date      $modificationDate The modification date
     * 
     * @return FormResponse
     */
    public function __construct(
        /*int*/       $formResponseId=null,
        /*IUser*/     $user=null,
        /*Form*/      $form=null,
        /*FormField*/ $field=null,
        Date          $modificationDate=null
    )
    {
        $this->_formResponseId = $formResponseId ;
        $this->_user = $user ;
        $this->_form = $form ;
        $this->_field = $field ;
        $this->_modificationDate = $modificationDate ;
    }

    /**
     * Getter for primary key
     *
     * @see Object::getId()
     *
     * @return array
     */
    public function getId()
    {
        $id = array();
        $id['formResponseId'] = $this->_formResponseId ;
        $id['user'] = $this->_user ;
        $id['form'] = $this->_form ;
        $id['field'] = $this->_field ;
        return $id ;
    }

    /**
     * Getter for the response id
     * 
     * @return int
     */
    public function getFormResponseId()
    {
        return $this->_formResponseId ;
    }
    
    /**
     * Setter for the response id
     * 
     * @param int $formResponseId The response id
     * 
     * @return void
     */
    public function setId(/*int*/ $formResponseId)
    {
        $this->setFormResponseId($formResponseId);
    }

    /**
     * Setter for the response id
     *
     * @param int $formResponseId The response id
     *
     * @return void
     */
    public function setFormResponseId(/*int*/ $formResponseId)
    {
        $this->_formResponseId = $formResponseId ;
    }

    /**
     * Getter for the user
     *
     * @return IUser
     */
    public function getUser()
    {
        return $this->_user ;
    }

    /**
     * Setter for the user
     *
     * @param IUser $user The user
     *
     * @return void
     */
    public function setUser(/*IUser*/ $user)
    {
        return $this->_user = $user ;
    }

    /**
     * Getter for the form
     *
     * @return Form
     */
    public function getForm()
    {
        return $this->_form ;
    }
    
    /**
     * Setter for the form
     *
     * @param Form $form The form
     *
     * @return void
     */
    public function setForm(/*Form*/ $form)
    {
        return $this->_form = $form ;
    }

    /**
     * Getter for the field
     *
     * @return FormField
     */
    public function getField()
    {
        return $this->_field ;
    }

    /**
     * Setter for the field
     *
     * @param FormField $field The field
     *
     * @return void
     */
    public function setField(/*FormField*/ $field)
    {
        return $this->_field = $field ;
    }

    /**
     * Getter for the modification date
     *
     * @return Date
     */
    public function getModificationDate()
    {
        return $this->_modificationDate ;
    }

    /**
     * Setter for the modification date
     *
     * @param Date $modificationDate The modification date
     *
     * @return void
     */
    public function setModificationDate(Date $modificationDate=null)
    {
        return $this->_modificationDate = $modificationDate ;
    }

    /**
     * Shows the FormResponse as a string
     *
     * @see Object::toString()
     *
     * @return string
     */
    public function toString()
    {
        return $this->_formResponseId ;
    }

}
